#include<iostream>
#include<string>
using namespace std;
typedef long long LL;
const int N = 1e3 + 10;
int n;
int a[N];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		if (n == 1) {
			cout << -1 << endl;
			continue;
		}
		bool flag = 0;
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
		}
		if (n & 1) {
			cout << a[n / 2 + 1] << " ";
			for (int i = n; i >= 1; i--) {
				if (i != n / 2 + 1) {
					cout << a[i] << " ";
				}
			}
			cout << endl;
		}
		else {
			for (int i = n; i >= 1; i--) {
				cout << a[i] << " ";
			}
			cout << endl;
		}
	}
	return 0;
}